package mua.core.operation.basis;

import mua.core.interpreter.Global;
import mua.core.value.FunctionBody;
import mua.core.value.MuaValue;

public class Erase {
    //functionBody为null时为全局变量
    public static MuaValue run(MuaValue a, FunctionBody functionBody){
        if(functionBody!=null&&functionBody.getLocalVariable().get(a.toString())!=null){
            return functionBody.getLocalVariable().remove(a.toString());
        }
        return Global.globalVariable.remove(a.toString());
    }
}
